#!/bin/sh

PREFIX=/opt/newcross/arm-cx2450x-linux-gnueabi/arm-cx2450x-linux-gnueabi/sys-root/usr
CCPATH=
HOST=arm-cx2450x-linux-gnueabi

export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
export CC=$CCPATH$HOST-gcc
export AR=$CCPATH$HOST-ar
export NM=$CCPATH$HOST-nm
export RANLIB=$CCPATH$HOST-ranlib
export OBJDUMP=$CCPATH$HOST-objdump
export STRIP=$CCPATH$HOST-strip

export CFLAGS="-Wall -g0 -O2 \
	 -D__KERNEL_STRICT_NAMES -DUSE_NEVIS_GXA \
	-I"$PWD"/include -I"$PWD"/include/linux/dvb -I"$PREFIX"/include/freetype2"

export CXXFLAGS="-Wall -g0 -O2 \
	 -D__KERNEL_STRICT_NAMES -DUSE_NEVIS_GXA \
	-I"$PWD"/include -I"$PWD"/include/linux/dvb -I"$PREFIX"/include/freetype2"

export LDFLAGS="-L"$PREFIX"/lib -lcurl -lssl -lcrypto -ldl"

export DVB_API_VERSION=3
export FREETYPE_CONFIG=$PREFIX/bin/freetype-config
export CURL_CONFIG=$PREFIX/bin/curl-config
export PKG_CONFIG_PATH==$PREFIX/lib/pkgconfig

./autogen.sh
./configure --prefix=${PREFIX} --build=i386-pc-linux-gnu --host=$HOST --with-target=cdk --with-targetprefix="" "$*"

